package org.vacoor.nothing.misc.express.usps.api;

import org.vacoor.nothing.misc.express.usps.api.address.ASRequest;
import org.vacoor.nothing.misc.express.usps.api.address.ASResponse;
import org.vacoor.nothing.misc.express.usps.api.data.UspsAddress;

/**
 *
 */
public class UspsTester {
    public static void main(String[] args) {
        String userId = "034I2GLO7047";
        String password = "089KU88WB902";

        final Usps usps = Usps.create(userId, password);

        // 地址验证
        ASRequest req = new ASRequest();
        UspsAddress addr = new UspsAddress();
        addr.setAddress2("6406 Ivy Lane");
        addr.setCity("Greenbelt");
        addr.setState("MD");
        req.add(addr);

        UspsResult<ASResponse> result = usps.postRequest(req, ASResponse.class);
        System.out.println(result);
    }
}
